import { Req, type Resp } from '@/utils/request'

export function uploadAvatar(files: File[]): Promise<Resp<any>> {
  return Req.$uploadFile('/user/avatar', 'file', files, {})
}

export function getUsersProfile(): Promise<Resp<UserProfile>> {
  return Req.$get<UserProfile>('/user/profile')
}

export function usersProfileUpdate(profile: UserProfile): Promise<Resp<UserProfile>> {
  return Req.$post<UserProfile>('/user/profile/update', profile)
}
